import request from "@/utils/request"

export const addSubject = (data) => {
  return request({
    url: `eduservice/subject/addSubject`,
    method: 'post',
    data
  })
}

export const deleteSubject = (data) => {
  return request({
    url: `eduservice/subject/deleteSubject/${data}`,
    method: 'delete',
  })
}

export const getAllSubject = (data) => {
  return request({
    url: `eduservice/subject/getAllSubject`,
    method: 'get',
    params: data
  })
}

export const getOneSubject = (data) => {
  return request({
    url: `eduservice/subject/getOneSubject`,
    method: 'get',
    params: data
  })
}

export const getSubject = (data) => {
  return request({
    url: `eduservice/subject/getSubject/${data}`,
    method: 'get'
  })
}

export const updateSubject = (data) => {
  return request({
    url: `eduservice/subject/updateSubject`,
    method: 'put',
    data
  })
}

export default { addSubject, deleteSubject, getAllSubject, getOneSubject, getSubject, updateSubject }